#pragma once
#include "NodeBase.h"
#include <juce_gui_basics/juce_gui_basics.h>

// 带文本标签的节点
class NodeWithLabel : public NodeBase
{
public:
    NodeWithLabel(const juce::String& labelText, const juce::String& text)
        : NodeBase(labelText), label({}, text)
    {
        addAndMakeVisible(label);
        label.setJustificationType(juce::Justification::centred);
    }

    void resized() override
    {
        NodeBase::resized();
        // Label放在节点下方
        label.setBounds(10, (int)(getTitleBarHeight()+15), getWidth() - 20, 24);
    }

private:
    juce::Label label;
};